home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.3 Development Libraries / SGI IRIX 6.3 Development Libraries.iso / dist6.3 / ViewKit_dev.idb / usr / include / Vk / VkScroll.h.z / VkScroll.h
Encoding:
C/C++ Source or Header  |  1996-09-20  |  2.9 KB  |  77 lines

  1. ////////////////////////////////////////////////////////////////////////////////
  2. ///////   Copyright 1992, Silicon Graphics, Inc.  All Rights Reserved.   ///////
  3. //                                                                            //
  4. // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;     //
  5. // the contents of this file may not be disclosed to third parties, copied    //
  6. // or duplicated in any form, in whole or in part, without the prior written  //
  7. // permission of Silicon Graphics, Inc.                                       //
  8. //                                                                            //
  9. // RESTRICTED RIGHTS LEGEND:                                                  //
  10. // Use,duplication or disclosure by the Government is subject to restrictions //
  11. // as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data     //
  12. // and Computer Software clause at DFARS 252.227-7013, and/or in similar or   //
  13. // successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -    //
  14. // rights reserved under the Copyright Laws of the United States.             //
  15. //                                                                            //
  16. ////////////////////////////////////////////////////////////////////////////////
  17. #ifndef _VK_SCROLL_
  18. #define _VK_SCROLL_
  19.  
  20. #include <Vk/VkComponent.h>
  21.  
  22. enum VkScrollReason { VS_none, VS_initialExpose, VS_resize, VS_troughPixmap };
  23.  
  24. typedef struct {
  25.   class VkScroll *obj;
  26.   VkScrollReason reason;
  27.   int width, height, depth, maximum;
  28.   Pixmap pixmap;
  29. } VkScrollCallback;
  30.  
  31. class VkScroll : public VkComponent {
  32.  
  33.   public:
  34.     
  35.     static const char *const scrollCallback;
  36.     
  37.     VkScroll(const char *name, Widget);
  38.     ~VkScroll();
  39.     
  40.     virtual const char* className();
  41.     
  42.     void setChild(Widget c);
  43.     int getScrollPos() { return scrollPos; }
  44.     void setScrollPos(int pos);
  45.     Widget getClip() { return clip; }
  46.     Widget getFrame() { return frame; }
  47.     Widget getScrollBar() { return sb; }
  48.     void recomputeScrollBar() { resizeClip(); }
  49.     void reannotateScrollBar();
  50.     void setAnnotations();
  51.  
  52.   protected:
  53.     void scrollChanged(int value);
  54.     void exposeClip();
  55.     void resizeClip();
  56.     void troughPixmap(int width, int height, int depth, int maximum,
  57.               Pixmap pixmap);
  58.     void callCallback(VkScrollReason reason);
  59.     
  60.     Widget frame, sb, clip, child;
  61.     int scrollPos;
  62.     Boolean annotations;
  63.     Dimension lastHeight;
  64.  
  65.   private:
  66.     
  67.     static void resize_clip(Widget w, XtPointer client_data, XEvent *event);
  68.     static void expose_clip(Widget w, XtPointer client_data, XEvent *event);
  69.     static void resize_child(Widget w, XtPointer client_data, XEvent *event);
  70.     static void scroll_changed(Widget w, XtPointer client_data,
  71.                    XtPointer call_data);
  72.     static void trough_pixmap(Widget w, XtPointer client_data,
  73.                   XtPointer call_data);
  74. };
  75.  
  76. #endif
  77.